﻿<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:include href="core\form.xsl"/>
	<xsl:include href="core\level0.xsl"/>
	<xsl:include href="core\common_templates.xsl"/>

	<xsl:template match="page">
		<xsl:call-template name="page_content"/>
	</xsl:template>
	
	<xsl:template name="page_content">
		<table cellpadding="4" cellspacing="1" width="95%" align="center">
			<xsl:choose>
				<xsl:when test="string-length(/page/autherror)>0">
					<tr><td><xsl:apply-templates select="autherror"/></td></tr>
				</xsl:when>
				<xsl:otherwise>
					<tr>
						<td>
							<xsl:call-template name="title_page">
								<xsl:with-param name="titleText">Contact Finance Company</xsl:with-param>
							</xsl:call-template>
											<xsl:if test="string-length(message)>0">
								<br/><br/><center><xsl:apply-templates select="message"/></center><br/><br/><br/>
							</xsl:if>
							<xsl:choose>
								<xsl:when test="//page/was_sent">
									<br/><br/><br/><br/>
								</xsl:when>
								<xsl:otherwise>
									<xsl:apply-templates select="form[@name='email']"/>
								</xsl:otherwise>
							</xsl:choose>
						</td>
					</tr>
				</xsl:otherwise>
			</xsl:choose>
		</table>
	</xsl:template>

	<xsl:template match="message">
		<b><font color="#FF0000"><xsl:value-of select="." disable-output-escaping="yes"/></font></b>
	</xsl:template>

	<xsl:template match="form[@name='email']">
		<form action="main.asp">
			<input type="Hidden" name="-finance_companies_email.asp-"/>
			<xsl:copy-of select="@*"/>
			<xsl:apply-templates select="control/input[@type='hidden']"/>
			<table cellpadding="2" cellspacing="2" align="center">
				<tr>
					<td class="titleblack" align="center" valign="top">
						<table cellpadding="2" cellspacing="2">
							<xsl:if test="//page/view_offices_email = 1">
								<tr>
									<td colspan="3" class="titleblack">
										<font class="imagetitle">Please choose the office wher you would like to send the leads:</font><br/>
										<xsl:apply-templates select="control[@name='office_email']"/><br/><br/>
									</td>
								</tr>
							</xsl:if>
							<tr>
								<td colspan="3" class="imagetitle">Please fill out the information below. All items marked "<font color="red">*</font>" are required entries.</td>
							</tr>
							<tr>
								<td class="titleblack" valign="bottom"><xsl:apply-templates select="control[@name='FirstName']"/></td>
								<td>&#160;&#160;&#160;</td>
								<td class="titleblack" valign="bottom"><xsl:apply-templates select="control[@name='LastName']"/></td>
							</tr>
							<tr>
								<td class="titleblack" valign="bottom"><xsl:apply-templates select="control[@name='HomePhone']"/></td>
								<td>&#160;&#160;&#160;</td>
								<td class="titleblack" valign="bottom"><xsl:apply-templates select="control[@name='WorkPhone']"/></td>
							</tr>
							<tr>
								<td class="titleblack" valign="bottom" colspan="3">
									<xsl:apply-templates select="control[@name='EmailFrom']"/>
									&#160;&#160;<xsl:apply-templates select="control[@name='send_request']"/>
								</td>
							</tr>
							<tr>
								<td class="titleblack" valign="bottom" colspan="3">
									<xsl:apply-templates select="control[@name='Comments']"/>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan="3" align="center">
						<input type="image" src="{$img_path_templates}/{$header_bg_color}/buttons/btn_email.gif" value="Contact" name="Contact" border="0"/>
					</td>
				</tr>
			</table>
		</form>
	</xsl:template>

	<xsl:template match="control[@name='send_request']">
		<xsl:apply-templates select="input">
			<xsl:with-param name="size_default">15</xsl:with-param>
		</xsl:apply-templates>
		Request a Return Receipt
	</xsl:template>
</xsl:stylesheet>
